public class TelNum {
	public static void main(String[] args) {
		String tel = "13805718332";
		enumAlph("",0,tel);//recusive
	}
	private static void enumAlph(String prefix, int offset, String tel) {
		char c = tel.charAt(offset);
		char begin = getStartChar(c);
		int n = c=='0'||c=='1'?1: (c=='7'||c=='9')?4:3;
		for(int i=0;i<n;i++){
			if(offset==tel.length()-1){
				System.out.println(prefix+(char)(begin+i));
			}else{
				enumAlph(prefix+(char)(begin+i), offset+1, tel);
			}
		}
		
	}
	private static char getStartChar(char c) {
		if(c=='1'||c=='0')return c;
		return 
		 (char) ('a'+3*(c-'2') + ((c>'7')?1:0));
	}
}
  